package cz.muni.fi.pa165.service.local;

import cz.muni.fi.pa165.dto.PackageDTO;
import java.util.List;
import javax.ejb.Local;

/**
 *
 * @author Jakub Janco
 */
@Local
public interface PackageServiceLocal {
    
      /**
     * Add new package to database
     * @return Long id of created object
     * @param pkg PackageDTO to add
     * @throws IllegalArgumentException if parameter is null
     */
    public Long createPackage(PackageDTO pkg);
    
    /**
     * Remove package from database
     * @param pkg 
     * @throws IllegalArgumentException if parameter is null the id attribute is null
     */
    public void removePackage(PackageDTO pkg);
    
    /**
     * Update package in database
     * @param pkg Package to update
     * @throws IllegalArgumentException if parameter is null the id attribute is null
     */
    public void updatePackage(PackageDTO pkg);
    
    /**
     * Return package by his ID
     * @param id Id of package to search
     * @throws IllegalArgumentException if parameter is null
     * @return Package with given ID, null if package with given ID is not in database
     */
    public PackageDTO getPackageById(Long id);
    
    /**
     * Return all packages in database
     * @return List of packages in database
     */
    public List<PackageDTO> getAllPackages();  
}
